<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="CommonUtil/CommonUtil.js"></script>
    <script type="text/javascript" charset="utf-8">
        function $() {
            var elements = [];
            for(var i = 0; i<arguments.length;i++){
                var element = arguments[i];
                if(typeof element=='string'){
                    element = document.getElementById(element);
                }
                if(arguments.length==1){
                    return element;
                }
                elements.push(element);
            }
            return elements;
        }
        var YAHOO = {};
        YAHOO.get = function (el) {
            if(typeof el=='string'){
                return document.getElementById(el);
            }
            if(el instanceof Array){
                var elements = [];
                for(var i = 0;i<el.length;i++){
                    elements[elements.length] = YAHOO.get(el[i]);
                }
                return elements;
            }
            if(el){
                return el;
            }
            return null;
        };
        YAHOO.get = YUIToPrototypeAdapter;
        function YUIToPrototypeAdapter() {
            if(arguments.length==1){
               var e = arguments[0];
                return $.apply(window,e instanceof Array?e:[e]);
            }else{
                return $.apply(window,arguments);
            }
        }
        window.onload = function () {
            //var domArr = $('inp1','inp2');
            //alert(domArr);
            //var domArr = YAHOO.get(['inp1','inp2']);
            //alert(domArr);
            //var domArr = YAHOO.get('inp1');
            //var domArr = YAHOO.get(['inp1','inp1']);
            var domArr = YAHOO.get('inp1','inp2');
            alert(domArr);
        }
    </script>
</head>
<body>
    <input id="inp1"/>
    <input id="inp2"/>
</body>
</html>